home *** CD-ROM | disk | FTP | other *** search
/ Web Designer 98 (Professional) / WebDesigner 1.0.iso / htmled1 / inp11db16.exe / data.z / lineitems.infile < prev    next >
Encoding:
Text File  |  1996-10-10  |  4.0 KB  |  133 lines

  1. $outvar(devnull)
  2. <!--------------------------------------------------------------------
  3.     po/lineitems.infile - Blend infile used to produce the
  4.                         html with the user selected line items. Behaviour
  5.                         changes based on whether the $ChangeValue variable
  6.                         is set to "Allow" or not.  If it is allow, the
  7.                         form will provide input fields for changing the 
  8.                         quantity of items chosen.
  9.                         Used by po.blend
  10.     
  11.     1996-09-25 RKJ-000    Original version
  12. -->
  13. $endout
  14. <!-- build the line item table -->
  15.     $set(tempcolspan,4)
  16.   <TABLE border=1 width="100%" >
  17.     <TR>
  18.       <TD align=center><STRONG>ITEM ID</STRONG></TD>
  19.       <TD align=center ><STRONG>ITEM NAME</STRONG></TD>
  20.         $if($equal($DisplayCategory,"TRUE"))
  21.             <TD align=center><STRONG>CATEGORY</STRONG></TD>
  22.             $inc(tempcolspan)
  23.         $endif
  24.       <TD align=center><STRONG>UNITS</STRONG></TD>
  25.       <TD align=center><STRONG>UNIT PRICE</STRONG></TD>
  26.       <TD align=center><STRONG>TOTAL PRICE</STRONG></TD>
  27.     </TR>
  28.  
  29.     <!-- loop through selected products for display purposes -->
  30.     $set(loop,0)
  31.     $set(bigTotal,0)
  32.     $set(badTotal,0)
  33.     $while($not($equal($ProductCount,$loop)))
  34.  
  35.         $if($var(ItemUnits$loop$))
  36.             $if($equal($var(ItemUnits$loop$),0))
  37.                 $if($var(ItemUnits$loop$check))
  38.                     $set(aVal,1)
  39.                 $else
  40.                     $set(aVal,0)
  41.                 $endif
  42.             $else
  43.                 $set(aVal,$var(ItemUnits$loop$))
  44.             $endif
  45.         $else
  46.             $if($var(ItemUnits$loop$check))
  47.                 $set(aVal,1)
  48.             $else
  49.                 $set(aVal,0)
  50.             $endif
  51.         $endif
  52.         $set(aVal,$fmt("%.0f",$aVal,"double"))
  53.         $if($not($equal($aVal,0)))
  54.             $if($var(ItemCost$loop$))
  55.                 $set(tempCost,$fmt("%.2f",$var(ItemCost$loop$),"double"))
  56.                 $if($and($gt($tempCost$,"0.00"),$le($tempCost$,"99999999.99")))
  57.                     $set(aTotal,$mult($aVal,$tempCost$))
  58.                 $else
  59.                     $set(aTotal,"N/A")
  60.                 $endif
  61.             $else 
  62.                 $set(aTotal,"N/A")
  63.             $endif
  64.             <TR>
  65.                 <TD>$var(ItemCode$loop$) </td>
  66.                 <td>$var(ItemName$loop$) </td>
  67.                 $if($equal($DisplayCategory,"TRUE"))
  68.                     <TD>$var(ItemCategory$loop$)</TD>
  69.                 $endif
  70.                 <TD> 
  71.                 $if($equal($ChangeValue,"Allow"))
  72.                     <INPUT TYPE="text" NAME="ItemUnits$loop$" VALUE="$aVal" SIZE="5">
  73.                 $else
  74.                     $aVal
  75.                     <INPUT TYPE=hidden NAME="ItemUnits$loop$" VALUE="$aVal" SIZE="5">
  76.                 $endif
  77.                 </TD>
  78.                 <td align="right">
  79.                 $if($var(ItemCost$loop$))
  80.                     $set(tempCost,$fmt("%.2f",$var(ItemCost$loop$),"double"))
  81.                     $if($and($gt($tempCost$,"0.00"),$le($tempCost$,"99999999.99")))
  82.                         $Currency$$tempCost$
  83.                     $else
  84.                         $var(ItemCost$loop$)
  85.                     $endif
  86.                     $if($var(ItemUnitOfMeasure$loop$)) / 
  87.                             $var(ItemUnitOfMeasure$loop$)$endif$ </td>
  88.                 $else 
  89.                     </TD>
  90.                 $endif
  91.                 $if($equal($aTotal,"N/A"))
  92.                     <td align="right">$aTotal$</td>
  93.                 $else
  94.                     <td align="right">$Currency$$fmt("%.2f",$aTotal$,"double") </td>
  95.                 $endif
  96.             </TR>
  97.             $if($equal($aTotal,"N/A"))
  98.                 $inc(badTotal)
  99.             $else
  100.                 $set(bigTotal,$add($aTotal,$bigTotal))
  101.             $endif
  102.         $else
  103.             <INPUT TYPE=hidden NAME="ItemUnits$loop$" VALUE="$aVal" SIZE="10">
  104.         $endif
  105.         $if($var(ItemUnits$loop$check))
  106.             <INPUT TYPE=hidden NAME="ItemUnits$loop$check" VALUE="on" SIZE="10">
  107.         $endif
  108.         $inc(loop)
  109.     $endwhile
  110.     <TR>
  111.         $if($equal($PageName,"Details"))
  112.             $set(tempcolspan,$minus($tempcolspan,1))
  113.             <TD colspan=$tempcolspan align="right">
  114.                 <INPUT TYPE=submit name=SubmitType VALUE="Recalculate">
  115.             </td>
  116.             $set(tempcolspan,1)
  117.         $endif
  118.         $if($gt($badTotal,0))
  119.             <TD colspan=$tempcolspan align="right"><STRONG>Grand Total*</STRONG></td>
  120.             <td align="right"><STRONG>N/A </STRONG></td>
  121.         $else
  122.             <TD colspan=$tempcolspan align="right"><STRONG>Grand Total*</STRONG></td>
  123.             <td align="right"><STRONG>$Currency$$fmt("%.2f",$bigTotal$,"double") </STRONG></td>
  124.         $endif
  125.     </TR>
  126.     </TABLE>
  127.     $if($gt($badTotal,0))
  128.         <center>*$badTotal$ item(s) have been selected which do not have a price.<br>  
  129.         This order will be treated as a Request For Quote.</center>
  130.     $else
  131.         <center>*Excluding shipping/handling and applicable taxes</center>
  132.     $endif
  133.